from bdtime import tt
import win32api


# 定义 Windows API 函数和常量
VK_LBUTTON = 0x01


# 检测鼠标左键状态的函数
def is_left_mouse_button_pressed():
    return win32api.GetKeyState(VK_LBUTTON) < 0


# 测试函数
def main():
    while True:
        if tt.stop():
            break

        if is_left_mouse_button_pressed():
            print("鼠标左键被按下")
        else:
            print("鼠标左键未被按下")


if __name__ == "__main__":
    main()


